<template>
    <div> 
        <home-header></home-header>
        <swiper :swiperList="swiperList"></swiper>
        <icons :navList="navList"></icons>
        <recommend :recommendList="recommendList"></recommend>
        <weekend :weekedList="weekedList"></weekend>
    </div>
</template>

<script>
import homeHeader from './components/header'
import swiper from './components/swiper'
import icons from './components/icons'
import recommend from './components/recommend'
import weekend from './components/weekend'

import axios from 'axios'
export default {
    name:"home",
    data(){
        return {
            title:"这里是首页标题",
            swiperList:[],
            navList:[],
            recommendList:[],
            weekedList:[]
        }
    },
    components:{
        homeHeader,
        swiper,
        icons,
        recommend,
        weekend
    },
    methods:{
        getHomeInfo(){
            axios.get('/static/mooc/index.json').then((res)=>{
                if(res.data.ret){
                    this.swiperList=res.data.data.swiperList;
                    this.navList=res.data.data.iconList;
                    this.recommendList=res.data.data.recommendList;
                    this.weekedList=res.data.data.weekendList
                }else{
                    alert("请求数据失败");
                }
            })
        }
    },
    mounted(){
        this.getHomeInfo();
    }
}
</script>
<style scoped>

</style>


